// dlg.txt

begintalkscript;

variables;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(10,2) == 0;
	question = "special";
	text1 = "When you get close to this building, you feel a strange chill. You notice that there are far fewer footprints on the ground here. The serviles have been staying away from here.";
	action = SET_SDF 10 2 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There are several serviles working in the fields. They are simple creatures, and strangers frighten them. They shy away from you when you get close.";
	text2 = "Serviles are used for a wide range of menial, unpleasant jobs. While non-Shaper humans often resent and envy the power of the Shapers, the ability to have their difficult work done for them by serviles does a lot to keep them happy.";

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There are several creations in these stables. Certain creations, because of the nature of their temperament or odor, are kept outside cities whenever possible.";

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  Mera - East";
	text3 = "  Minallah, Foundry - North";
	text4 = "  Mera Fens - South";

begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  Warning! Mera Fens Are Infested With Unbound";
	text3 = "  Stay Away! Many Traps Have Been Placed";

// 
begintalknode 10;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Modell";
	text1 = "There is a small band of refugees in this clearing. Refugees are a common sight in these turbulent times. Multitudes have left their war-torn homelands in the hope of finding a more peaceful place to live. Few succeed.";
	text2 = "This man speaks for this group. He approaches you nervously, clearly afraid that you are just another brigand. He extends a hand and says, _I am Modell. I wish you peace, and I hope that you give us the same._";
	text3 = "He offers you tea from a cracked ceramic pot kept warm by their fire. _We have had a difficult journey. If you own this land, know that we hope not to tarry here long._";
	text5 = "Modell sits and sips his tea. _Is there anything else you wish to know? We do not hope to stay here for long. We will depart as soon as it is safe._";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = 11;
	condition = 1;
	question = "Where are you from?";
	text1 = "_We hail from a small village on the southwest border of the Mera Fen. I doubt you have heard of it. Now that it has been destroyed, few will hear of it again._";
	text2 = "_We came north, hoping to hide in the mountains. That effort was a failure._";

begintalknode 12;
	state = 10;
	nextstate = 13;
	condition = 1;
	question = "Why are you camping here?";
	text1 = "_We are going to Mera. We think we will be able to find lodgings and work there._";
	text2 = "_And yet, our poor luck torments us at every turn. The main road to Mera is blocked by a brigand, and we cannot afford to pay him. We are trapped here until we have a chance to slip by._";

begintalknode 13;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "Do you have any goods for sale?";
	text1 = "_Everything we can sell, we have. What little we have left we hope to trade for lodgings in Mera. If we ever get there._";
	text2 = "He might not be telling the truth. He might be concealing the extent of his wealth, in case you turn out to be a bandit. But you doubt it.";
	
begintalknode 14;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "Good day.";
	text1 = "Modell seems relieved that you aren't about to rob his people. _And a good day and safe travels to you._";
	action = END_TALK;
	
begintalknode 15;
	state = 11;
	nextstate = 12;
	condition = 1;
	question = "What destroyed your village?";
	text1 = "_Several of the Unbound live in the Mera Fen. Usually, the Unbound are hunted and destroyed. These escaped our soldiers, though. The fen helps them to hide._";
	text2 = "_One day, an Unbound walked near our village. When it saw us, its natural instincts took over._";

begintalknode 16;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "What happened in the Whitespires?";
	text1 = "_We were turned away without a word. Shaper Rawal ordered the soldiers at the gate blocking the pass to turn us all away._";
	text2 = "_It was soon obvious that Shaper Rawal has no pity for his poor countrymen. We turned back and set off for a new destination._";

begintalknode 17;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "What happened then?";
	text1 = "_The Unbound do two things. Wander. And destroy. Our sentries saw it coming, so all of the villagers were able to flee into the woods. We watched, from a distance, as our homes and crops were burned away._";
	text2 = "_Then we left. We could no longer stay there. Just more pitiful wanderers who had lost everything to the rebels._";

begintalknode 18;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "Why do you think you will have better luck in Mera?";
	text1 = "_This province is ruled by Councilor Astoria, who controls all from her Citadel in Mera._";
	text2 = "_She has not yet tired of trying to care for those of her people who have fled from their homes. We hope to get to Mera and find a place to live before her generosity fades. As, I promise you, it will._";

begintalknode 19;
	state = 13;
	nextstate = 14;
	condition = 1;
	question = "Tell me more about this brigand.";
	text1 = "_His name is Koski. He is a servile. By himself, he would be dangerous. Worse, he has a pack of creations that answer to him._";
	text2 = "_He demands money from all who would pass. We can't afford to spare a single coin, not if we are to afford food and lodgings in Mera. So we are trapped._";
	
begintalknode 20;
	state = 14;
	nextstate = -1;
	condition = 1;
	question = "Why don't the Mera guards get rid of Koski?";
	text1 = "_I do not know. Councilor Astoria hasn't sent out her soldiers to patrol the roads or fight rogues. We have seen few of her warriors or creations during our travels._";
	text2 = "_I have heard rumors of why this might be, but I do not repeat rumors._";

begintalknode 21;
	state = 14;
	nextstate = -1;
	condition = 1;
	question = "Where is this Koski from?";
	text1 = "_We did not chat with him. Many serviles have fled from their Shaper masters. Some went to fight for the rebels. Some hid in the wilds, hoping simply to be left alone._";
	text2 = "_And a few of them showed previously unsuspected diabolical intent. The Shapers tried to make serviles be simpler, more moral creatures. They did not always succeed._";

begintalknode 22;
	state = 14;
	nextstate = -1;
	condition = 1;
	question = "Perhaps I can scare off Koski for you.";
	text1 = "Modell looks at your arms and armor and nods. _You might be able to. If you did, we could offer you little as a reward. We would be very grateful, though._";
	code = 
		set_flag(10,5,1);
		toggle_quest(40,1);
	break;
	
begintalknode 23;
	state = 14;
	nextstate = 10;
	condition = gf(10,5) == 0;
	question = "That is unfortunate. There is something else I want to know.";
	text1 = "_What is it?_";

begintalknode 24;
	state = 10;
	nextstate = -1;
	condition = gf(10,5) == 1 && gf(10,1) > 0;
	question = "Koski is gone. You can get to Mera now.";
	text1 = "Modell is relieved to hear this news. _This is a tiny stroke of good fortune. Now we can get to Mera. That is where our struggle will truly begin. We will have to make a life._";
	text2 = "_It was a victory won at great cost, though. With his final vicious stroke, Koski cost us much._";
	text3 = "The refugees immediately begin to pack up their supplies. Modell says, _We will be packing light and moving fast. Please feel free to take anything we leave behind. Thank you again for your help._";
	action = END_TALK;
	code =
		sf(10,5,2);
		toggle_quest(40,3);
		award_party_xp(200,5);	
		if (gf(10,4) == 0)
			rs(2);
	break;
	
begintalknode 27;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "The refugees are desperate to reach Mera before yet another disaster befalls them. They don't stop to talk.";
	
begintalknode 28;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "You try to speak with one of the refugees. They are all working very hard to keep their little camp functioning. They don't stop and talk.";
	text2 = "You try to speak with one of the refugees. They are all consumed with grief. The recent attack of the rogues hit them hard.";
	text3 = "One of them says, _Please excuse us. Modell speaks for us._";
	text4 = "You inform them that the road to Mera is clear. They immediately begin to pack up their supplies. They are packing light and moving fast.";
	code =
		if (gf(10,4) == 0)
			rs(2);
			else rs(1);
		rs(3); rs(4);
		if ((gf(10,3) > 0) && (gf(10,1) > 0)) {
			as(4);
			if (gf(10,5) == 1) {
				toggle_quest(40,3);
				award_party_xp(200,5);	
				}
			sf(10,5,2);
			}
			else if (gf(10,3) == 0)
				as(3);
	break;
	
begintalknode 29;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";


//

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Sergeant Tasha";
	text1 = "There is a small band of soldiers guarding the farmlands just west of the city of Mera. It isn't surprising that they have a patrol out here, though it seems to be keeping oddly close to the city.";
	text2 = "When the ranking soldier sees you, she immediately waves for you to halt. _I'm Sergeant Tasha of Mera. You are a stranger here. Maybe a spy. I'll need to see some papers of transit, or you're going to have a problem._";
	text5 = "Sergeant Tasha and her soldiers watch you suspiciously. They still seem mostly convinced that you are a spy, rebel, or other treacherous presence. Papers of transit or no.";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = -1;
	condition = gf(10,6) == 0;
	question = "I don't need to answer to you.";
	text1 = "She places her hand on the hilt of her blade. _Yes, you do. You are an armed stranger outside our city. Justify your presence here, or the full force of Mera will collapse on you._";
	text2 = "It doesn't seem to be an idle threat. Resistance at this point would be suicidal.";

begintalknode 32;
	state = 30;
	nextstate = -1;
	condition = gf(10,6) == 0;
	question = "Here are my papers. (Show them.)";
	text1 = "She takes the papers and inspects them. _From Shaper Rawal, eh? Another good reason not to trust you._";
	text2 = "Then she looks up at you. _A servile? With these papers? I knew Rawal was treacherous and disloyal to the Shaper cause. I didn't know he was crazed._";
	text3 = "She hands the papers back to you. _They have a Councilor's signature. I'm not going to take the risk of turning you away. You may pass, but I'll make sure the guards watch you every moment._";
	code =
		sf(10,6,1);
		if (creature_type(pc_num()) != 46) 
			rs(2);
	break;
	
begintalknode 33;
	state = 30;
	nextstate = -1;
	condition = gf(10,6) > 0;
	question = "Tell me more about Mera.";
	text1 = "She points to the east. _That's it. Go in and you can see more. I'm not your guide._";

begintalknode 34;
	state = 30;
	nextstate = -1;
	condition = gf(10,6) > 0;
	question = "I need more supplies.";
	text1 = "She looks shocked. _You dare ask me ... Listen, friend. You are lucky I don't have a dozen clawbugs hunting you down. You can go into Mera. That is the best you will get from me._";

begintalknode 35;
	state = 30;
	nextstate = 31;
	condition = gf(10,6) > 0 && gf(10,9) == 0 && gf(10,7) > 0 && gf(10,1) == 0;
	question = "I was just accosted by a bandit. Name was Koski.";
	text1 = "You tell Sergeant Tasha about the encounter. She seems unmoved. _You think I care? You think this little band has the ability to fight every rogue and thug in the Mera-Tev?_";
	text2 = "_Councilor Astoria passed down the orders. We follow them. We patrol from the gate to the pillars and back._";

begintalknode 36;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "Why does Astoria keep you so close to the city?";
	text1 = "_Oh, yes. The Shapers have constant intimate little chats with an outsider like me, letting me know their plans and schemes. They tell me everything about them. And then we have tea and hugs._";

begintalknode 37;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "Bandits and rogues just outside the city don't bother you?";
	text1 = "_No more than spies and agents from Shaper Rawal coming to cause trouble do._";

begintalknode 38;
	state = 31;
	nextstate = -1;
	condition = get_stat(20) < 6;
	question = "The bandit interrupted me while I was performing the business of a Councilor. I demand that you do something.";
	text1 = "You adopt your most commanding voice, but it isn't adequate. Tasha snorts. _I've had enough of you. Mera is right there. Move on and let us get back to our work._";
	action = END_TALK;

begintalknode 39;
	state = 31;
	nextstate = -1;
	condition = get_stat(20) >= 6;
	question = "The bandit interrupted me while I was performing the business of a Councilor. Do something, or I will show you what real trouble is.";
	text1 = "You adopt your most commanding voice. Your words crack through the sergeant's shell of mistrust and contempt. No outsider wants to attract the wrath of a Shaper.";
	text2 = "_Fine. We will expand our patrol. We'll move farther west. If we encounter this bandit and he causes trouble, we'll do our job._";
	text3 = "They turn and march off without another word.";
	action = END_TALK;
	code =
		sf(10,9,1);
		award_party_xp(100,5);
	break;
	
begintalknode 40;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "There is something else I want to know.";
	text1 = "_Ask someone else. We are done here._ The soldiers march on.";
	action = END_TALK;

begintalknode 41;
	state = 30;
	nextstate = -1;
	condition = gf(10,6) > 0;
	question = "There is something else I want to know.";
	text1 = "_Ask someone else. We are done here._ The soldiers march on.";
	action = END_TALK;

begintalknode 47;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "The soldier watches you suspiciously as you approach. He shuts off your questioning by saying, _Talk to Sergeant Tasha. She is in charge._";
	
//

begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Koski";
	text1 = "There is a servile standing at this crossroad. Not your standard, loyal, submissive servile. He is filthy and has a feral look. He has a loaded baton in his hand and wears a horn around his neck.";
	text2 = "Any questions of his intent are soon answered. He points the baton at your chest and says, _Koski say stop! Koski take pay from all who pass. No pay and Koski call many rogue on you._";
	text3 = "He points his baton at you. _So we meet new time. You pass again, you pay again._";
	text4 = "Koski eyes your weapon and thinks for a bit. He decides that it would be unwise to demand too much. _You pay five coin and you go. No pay and rogue on you._";
	text5 = "The servile waves you by. _You can go by. No talk. Just go. And stay out of my woods._";
	code =
		clear_strings();
		if (gf(10,8) > 0)
			as(5);
			else if (gf(10,7) > 0) {
				as(1); as(3); as(4);
				}
				else {
					sf(10,7,1);
					as(1); as(2); as(4);
					}
	break;
	
begintalknode 51;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "Where are your rogues?";
	text1 = "He raises the horn to his lips and blows a single short note. He is immediately answered by the snarls of a number of creations from the woods to the south. _No bluff. I beat creations and they follow. They fight for me._";
	
begintalknode 52;
	state = 50;
	nextstate = -1;
	condition = creature_type(pc_num()) != 46;
	question = "You dare to try and rob me? Do you know who I work for?";
	text1 = "_Do not know. Or care. You humans hurt serviles. Think us dumb. Love to make you pay._";
	
begintalknode 53;
	state = 50;
	nextstate = -1;
	condition = creature_type(pc_num()) == 46;
	question = "I am a servile. You'd make me pay?";
	text1 = "Koski thinks about this. _You right. I not hurt servile. You go by._";
	text2 = "_Stay out of path to south. No go on path with skulls. That Koski land. You go and I fight you._";
	text3 = "He waves you by.";
	action = END_TALK;
	code =
		sf(10,8,1);
	break;
	
begintalknode 54;
	state = 50;
	nextstate = -1;
	condition = coins_amount() < 5;
	question = "I don't have that much money.";
	text1 = "_What? You traveler with big weapon and armor. No money?_ You shake your head.";
	text2 = "Koski considers demanding some of your equipment and decides that it would inevitably mean a fight he'd rather avoid.";
	text3 = "_You pay next time. Stay out of path to south. No go on path with skulls. That Koski land. You go and I fight you._";
	text4 = "He waves you by.";
	action = END_TALK;
	code =
		sf(10,8,1);
	break;
	
begintalknode 55;
	state = 50;
	nextstate = -1;
	condition = coins_amount() >= 5;
	question = "Fine. I'll pay. (Give 5 coins.)";
	text1 = "Koski pockets the meager toll. _Good. No fight good for you and me._";
	text2 = "_Stay out of path to south. No go on path with skulls. That Koski land. You go and I fight you._";
	text3 = "He waves you by.";
	action = END_TALK;
	code =
		sf(10,8,1);
		change_coins(-5);
	break;
	
begintalknode 56;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "I refuse to pay.";
	text1 = "Koski checks his baton to make sure that it is loaded. It is. Then he takes aim ...";
	action = END_TALK;


begintalknode 60;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Koski looks down at the long, bloody scratch he has received. He raises his horn to his lips and blows a single, short note.";

begintalknode 61;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "The sound of a horn echoes through the woods to you. It is a single, sharp note.";

begintalknode 62;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Koski seems close to collapse. He realizes that you are too dangerous a foe.";
	text2 = "_You kill Koski? Koski can kill too. Koski not die alone._ He raises his horn to his lips and lets out a long, low note.";

begintalknode 63;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "The sound of a horn echoes through the woods to you. It is a long, low note. In the distance, you hear rogues rushing through the undergrowth.";

begintalknode 64;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

//

begintalknode 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode 71;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

//

begintalknode 90;
	state = -1;
	nextstate = 90;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode 91;
	state = 90;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
		